<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>重复执行相同的代码</title>
    <!--<script>
        for(var i = 0;i <= 10; i++){
            console.log('重要的事情说10遍');
        }
    </script>-->
    <script>
        var num = prompt('请您输入次数');
        for(var i = 1; i <= num; i++){
            console.log('重要的事情说' + num + '遍');
        }
    </script>
</head>
<body>

</body>
</html>